<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<link rel="stylesheet"
	href='<c:url value="/resources/css/redmond/jquery-ui-1.8.16.custom.css"/>' />
<script type="text/javascript"
	src='<c:url value="/resources/js/jquery-ui-1.8.16.custom.min.js"/>'></script>
<script type="text/javascript"
	src='<c:url value="/resources/js/fund/appropriationApprovementList.js"/>'></script>

<c:if test="${empty pagingBean.data }">
	<p class="msg info">没有符合条件的记录</p>
</c:if>

<c:if test="${!empty pagingBean.data }">
	<table>
		<tbody>
			<tr>
				<th>序号</th>
				<th>拨款原因</th>
				<th>拨款金额</th>
				<th>申请人</th>
				<th>申请时间</th>
				<th>申请状态</th>
				<th>审批时间</th>
				<th>审批意见</th>
			</tr>

			<c:forEach items="${pagingBean.data }" var="application"
				varStatus="status">
				<c:if test="${status.count%2==0}">
					<tr class="odd">
				</c:if>
				<c:if test="${status.count%2!=0}">
					<tr>
				</c:if>
				<td>${(pagingBean.currentPage-1)*pagingBean.pageSize +
					status.count }</td>
				<td>${application.reason }</td>
				<td>${application.amount }</td>
				<td>${application.applicantName}</td>
				<td>${application.applyDate}</td>
				<td>${application.approveStatus.status}</td>
				<td>${application.approveDate}</td>
				<td>
				<c:if test="${application.approve }">已批准</c:if>
				<c:if test="${application.reject }">已拒绝:${application.rejectReason}</c:if>
				<c:if test="${application.inProgress }">
					<label id="operate_${application.id}"><a href="#" onclick="approve('${application.id}')">同意</a> | <a href="#" onclick="reject('${application.id}')">拒绝</a></label></td>
				</c:if>
				</tr>
			</c:forEach>

			<tr>
				<th colspan="8" class="t-right"><c:if
						test="${pagingBean.hasPreviousPage }">
						<input id="previousButton" type="button" value="上一页">
						<input id="previousPageIndex" type="hidden"
							value="${pagingBean.previousPage}">
					</c:if> <c:if test="${!pagingBean.hasPreviousPage }">
						<input id="previousButton" type="button" disabled="disabled"
							value="上一页">
					</c:if> <input id="currentPageIndex" type="hidden"
					value="${pagingBean.afterDeletePage}"> <select
					name="pageIndex" id="pageSelection">
						<c:if test="${empty pagingBean.data }">
							<option selected="selected" value="1">第1页</option>
						</c:if>
						<c:if test="${!empty pagingBean.data }">
							<c:forEach items="${pagingBean.pageIndexList }" var="index">
								<c:if test="${index==pagingBean.currentPage }">
									<option selected="selected" value="${index }">
										第${index }页</option>
								</c:if>
								<c:if test="${index!=pagingBean.currentPage }">
									<option value="${index }">第${index }页</option>
								</c:if>
							</c:forEach>
						</c:if>
				</select> <c:if test="${pagingBean.hasNextPage }">
						<input id="nextButton" type="button" value="下一页">
						<input id="nextPageIndex" type="hidden"
							value="${pagingBean.nextPage}">
					</c:if> <c:if test="${!pagingBean.hasNextPage }">
						<input id="nextButton" type="button" disabled="disabled"
							value="下一页">
					</c:if></th>
			</tr>
	</table>
</c:if>